

$('.change_password').click(function(){
							layer.open({
					     						   type: 2
											        ,title: false
											        ,anim:1
											        ,closeBtn: 1
											        ,area:['400px','300px']
											        ,shade: 0
											        ,id: 'LAY_layuipro' 
											        ,shadeClose:true
											        ,shade:0.6
											        ,btnAlign: 'c'
											        ,moveType: 1 
											        ,content:'http://www.puer.zone:9000/change_password.html'
											 })
})
var userRightName = $.cookie('UserRightText');
var userRight = $.cookie('UserRight');
console.log(userRight)
if(userRight==null){
	window.location.href="http://www.puer.zone:9000/login.html";
}
//判断权限
var Title = document.title;
var page_kind;
 if(Title.indexOf('订单')>-1&&Title.indexOf('数据')<0){
  	page_kind=1;
  }else if(Title.indexOf('商品')>-1&&Title.indexOf('数据')<0){
  	page_kind=2;
  }else if(Title.indexOf('账号')>-1){
  	page_kind = 4;
  }else{
  	page_kind=3;
  }

 if(userRight==4&&page_kind!=4){
 	layer.msg('您只有查看订单模块的权力',{time:1500},function(){
 		window.location.href="http://www.puer.zone:9000/hire_order.html";
 	})
 	
 }

 if(userRight==3&&page_kind!=3){
	layer.msg('您只有查看商品模块的权力',{time:1500},function(){
 		window.location.href="http://www.puer.zone:9000/product_list.html";
 	})
 }
 
 if(userRight==2&&page_kind==2){
	layer.msg('您只有查看管理员模块的权力',{time:1500},function(){
 		window.location.href="http://www.puer.zone:9000/index.html";
 	})
 }

$('.manger-name').text(userRightName);
 $('.clear_date').click(function(){
			  $('#reservation').val('请选择时间')
		});


$(".exit_login").click(function () {
    $.cookie("UserId",null);
    $.cookie("UserRight",null);
    $.cookie("UserRightText",null);
    location.reload();
});



